package net.huashitong.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;

import net.huashitong.user.dao.DynamicUserDao;
import net.huashitong.user.entity.Dynamic;
import net.huashitong.user.entity.DynamicUser;

@Service
public class DynamicUserService extends StringPKService<DynamicUser>{
	@Autowired
	private DynamicUserDao dao;
	@Autowired
	private SysTableService tableService;
	@Override
	protected BaseDao<DynamicUser,String> getDao(){
		return dao;
	}
	@Override
	protected void beforeSave(DynamicUser dynamic) {
		dynamic.setSysId(tableService.updateMaxSysId("t_gis_dynamic_user",null));
	}
	public DynamicUser queryByUserIdAndDYnamcId(String userId,String dynamicId){
		return dao.queryByUserIdAndDYnamcId(userId, dynamicId);
	}
}
